home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 149 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: hsun13.hou281.chevron.com!gacwra
  2. From: gacwra@hsun13.hou281.chevron.com (C.W.Racer)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Infrequent use of do while, C Idioms
  5. Date: 2 Jan 1996 21:08:08 GMT
  6. Organization: Chevron
  7. Distribution: world
  8. Message-ID: <1996Jan2.150509@hsun13.hou281.chevron.com>
  9. References: <49slsq$10l@panix2.panix.com> <4a5pk6$pvd@ixnews6.ix.netcom.com> <1995Dec7.154222.9354@lamont.ldgo.columbia.edu>
  10. NNTP-Posting-Host: hsun13.hou281.chevron.com
  11.  
  12. In article <1995Dec7.154222.9354@lamont.ldgo.columbia.edu>, mike@armchair.mb.ca (Mike Forster) writes:
  13. |> cjds@ix.netcom.com (Bill Horger) wrote:
  14. |> 
  15. |> [snipped]
  16. |> 
  17. |> >
  18. |> >| So, anyhow, I was thinking and I realized that I have never ever seen
  19. |> >| a
  20. |> >| do {
  21. |> >| } while (condition)
  22. |> >
  23. ---------------------------------stuff deleted -----------------------
  24.  
  25. The issue here is do you want the loop 'top-tested' or 'bottom-tested'?
  26. Most c programmers prefer (seems to me) the top-tested loop.  Once in a
  27. while I'll find the other one seems to fit better.  
  28.  
  29. PL/1 DO loops allow both (using the 'while' and 'until' for top and
  30. bottom tested).  I actually used that once but only because it intrigued
  31. me.
  32. -- 
  33. | Chick Racer                     Chevron Petroleum Technology Co. |
  34. | (713) 596-2430                  P.O. Box 42832                   |
  35. | gacwra@chevron.com              Houston, Tx 77242-2832           |
  36. | 4119 Hayes Rd.                                                   |
  37.